/**
 * Copyright (c) 2019, ShangHai YTO Co., Ltd.
 * All right reserved.
 * <p>
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF YTO
 * CO., LTD.  THE CONTENTS OF THIS FILE MAY NOT BE DISCLOSED
 * TO THIRD PARTIES, COPIED OR DUPLICATED IN ANY FORM, IN WHOLE OR IN PART,
 * WITHOUT THE PRIOR WRITTEN PERMISSION OF YTO
 * CO., LTD.
 */
package org.sc.xl.algorithm;

/**
 * @author FXL
 * @description: TODO 请在此添加描述
 * @reason: TODO ADD REASON(可选)
 * @date 2022/8/25 19:19
 * @since JDK 1.8
 */


import com.alibaba.fastjson.JSONArray;
import lombok.Data;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 组件的条件信息
 */
@Data
class LabelAndValue {
    String label;//岗位统计
    String value;//yto-dimension-0a4bca1d-f8ca
    boolean tabHidden;//是否隐藏
}

@Data
class ConditionItem {
    String id;//条件组件的id 40b23cd9-f5f6
    String name;//条件组件的name yto-dimension
    String label;//残疾人就业数据
    String value;//col-095c5db1-05a5
    List<LabelAndValue> children;//条件组件的科目信息

}

public class Test {

    public static void main(String[] args) {
        String conditions = "[{\"children\":[{\"label\":\"出港超时\",\"tabHidden\":false,\"value\":\"yto-head-tabs-56f924ba-c047\"},{\"label\":\"进港超时\",\"tabHidden\":false,\"value\":\"yto-head-tabs-794149d3-166f\"}],\"id\":\"85581d6e-8515\",\"label\":\"yto-head-tabs\",\"name\":\"yto-head-tabs\",\"value\":\"\"},{\"children\":[{\"label\":\"实时\",\"tabHidden\":false,\"value\":\"yto-head-tabs-56f924ba-c047_realtime\"},{\"label\":\"日\",\"tabHidden\":false,\"value\":\"yto-head-tabs-56f924ba-c047_date\"},{\"label\":\"月\",\"tabHidden\":false,\"value\":\"yto-head-tabs-56f924ba-c047_month\"},{\"label\":\"年\",\"tabHidden\":false,\"value\":\"yto-head-tabs-56f924ba-c047_year\"}],\"id\":\"219eb796-8870\",\"label\":\"yto-date-panel\",\"name\":\"yto-date-panel\",\"value\":\"\"},{\"children\":[{\"label\":\"全部\",\"tabHidden\":false,\"value\":\"yto-dimension-36b06d11-30a2\"},{\"label\":\"早班\",\"tabHidden\":false,\"value\":\"yto-dimension-4035135d-cab9\"},{\"label\":\"中班\",\"tabHidden\":false,\"value\":\"yto-dimension-2608add6-ccdd\"}],\"id\":\"b26a9dde-feea\",\"label\":\"yto-dimension\",\"name\":\"yto-dimension\",\"value\":\"\"},{\"children\":[{\"label\":\"超时库存\",\"tabHidden\":false,\"value\":\"yto-dimension-b6444b44-1e5b\"},{\"label\":\"未解决\",\"tabHidden\":false,\"value\":\"yto-dimension-393018b9-7031\"}],\"id\":\"49fbfa4c-63bc\",\"label\":\"yto-dimension\",\"name\":\"yto-dimension\",\"value\":\"\"}]\n";

        List<ConditionItem> conditionItemList = JSONArray.parseArray(conditions, ConditionItem.class);

        List<LabelAndValue> traverseList = new ArrayList<>();

        List<String> resultList = new ArrayList<>();

        for (int i = 0; i < conditionItemList.size(); i++) {
            resultList.addAll(conditionItemList.get(i).getChildren().stream().map(LabelAndValue::getValue).collect(Collectors.toList()));
            for (int j = i + 1; j < conditionItemList.size(); j++) {
                for (int m = j + 1; m < conditionItemList.size(); m++) {
                    for (int n = m + 1; n < conditionItemList.size(); n++) {
                    }
                }
            }

            for (int j = i + 1; j < conditionItemList.size(); j++) {
                for (int m = j + 1; m < conditionItemList.size(); m++) {
                    for (int n = m + 1; n < conditionItemList.size(); n++) {
                    }
                }
            }

        }


        System.err.println(traverseList);


        System.out.println("===============================================================================");


    }


    public List<String> dfs(int index, List<LabelAndValue> labelAndValueList, List<String> resultList) {
        if (index == labelAndValueList.size() - 1) {
            return resultList;
        }


        return null;
    }
}